extends Node2D

var save_ball : Array[CharacterBody2D]
var current_ball : CharacterBody2D


func _ready() -> void:
	_load_data()

func _load_data() -> void :
	var list = [
			{
				"name" : "白球", #球名字
				"path" : "uid://0eojo5s1ky0t", #加载路径
				"is_lock" : false, #否解锁
				"fouce" : 30.0, #击球力度
				"bounce_rate" : Vector2(0.7,0.6) #反弹与摩擦系数，最佳系数0.2,0.4
			}
		]
	for ball_item in list :
		var ball_path = ball_item.path
		var ball : BaseGolf = load(ball_path).instantiate()
		ball.data_item.is_lock = ball_item.is_lock
		ball.data_item.ball_name = ball_item.name
		ball.data_item.fouce = ball_item.fouce
		ball.data_item.bounce_rate = ball_item.bounce_rate
		GlobalData.save_ball.append(ball)
